package com.service;

import com.entity.Resource;
import com.github.pagehelper.PageInfo;
import com.vo.ResourceAndPageInfoVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 陈忠杰
 * @Date: 2021/07/01/13:43
 * @Description:关于作者资源的Service接口
 */
public interface ResourceService {

    PageInfo<Resource> getResourceByUserIdAndPageNo(int userId,int pageNo);


    /**
    * @Description: 添加Resource数据表数据
    * @Param: [title, file_size, file_type, cost_type, cost_number, userId, chapter_id, status]
    * @return: int
    * @Author: 陈忠杰
    * @Date: 2021/7/2
    */
    //addResource(title,filename,resource.getFile_size(),substring,resource.getCost_type(),resource.getCost_number(),1,0);
    int addResource(String title, String path, String original_name, long file_size, String file_type, int cost_type, int cost_number, int userId, int chapter_id, int status);
    int updResource(String title, String path, String original_name, long file_size, String file_type, int cost_type, int cost_number, int userId, int chapter_id, int status,int id);
    int delResource(int id);
    int changeStatus(int id,int status);
    PageInfo<Resource> findBackResourceByInfo(ResourceAndPageInfoVO resourceAndPageInfoVO);

    Resource getResourceById(int id);
}
